<template>
  <div class="news">
    <div class="news-min">
      <div class="swiper">
        <el-carousel height="400px" autoplay>
          <el-carousel-item>
            <img
              class="img-item"
              src="https://img0.baidu.com/it/u=3422287847,344441285&fm=253&fmt=auto&app=120&f=JPEG?w=604&h=500"
            />
          </el-carousel-item>
          <el-carousel-item>
            <img
              class="img-item"
              src="https://img0.baidu.com/it/u=3422287847,344441285&fm=253&fmt=auto&app=120&f=JPEG?w=604&h=500"
            />
          </el-carousel-item>
        </el-carousel>
      </div>
      <div class="content">
        <ul class="news-list">
          <li v-for="item in 7">
            <a href="">
              <P>《原神》「三界路飨祭」玩法说明</P>
              <P>2020/02/16</P>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ElCarousel, ElCarouselItem } from "element-plus";
</script>

<style lang="scss" scopped>
.img-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news {
  position: relative;
  width: 100%;
  background: url(../asset/news-bg.jpg) no-repeat center/cover;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #aaa19d;
  padding: 40px 0;
}

/* 新闻信息 */
.news-min {
  width: 1280px;
  height: 400px;
  display: flex;
  border: 1px solid black;
}

/* 轮播图 */
.news .swiper {
  position: relative;
  width: 640px;
  height: 100%;
  overflow: hidden;
}

/* 新闻信息 */
.news-min .content {
  position: relative;
  width: 640px;
  height: 100%;
  padding: 0 24px;
  background-color: rgba(38, 18, 12, 0.62);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 新闻导航 */
.news-min .content .nav {
  top: 35px;
  width: 100%;
  margin-top: 35px;
  border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.news-min .content .nav-item {
  position: relative;
  float: left;
  font-size: 18px;
  padding: 0 19px 12px 19px;
  cursor: pointer;
}

.news-min .content .nav-item:hover {
  color: #ffd49f;
}

.news-min .content .nav-item.active::after {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background-color: #ffd49f;
  position: absolute;
  left: 0;
  bottom: -3px;
}

.news-min .news-list {
  width: 100%;
}

/* 消息内容 */
.news-min .news-list a {
  display: flex;
  justify-content: space-between;
  height: 52px;
  line-height: 52px;
  padding: 0 11px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  transition: 0.3s;
}

.news-min .news-list a p:last-child {
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
}

.news-min .news-list a:hover {
  background-color: rgba(255, 212, 159, 0.06);
}

.news-more {
  color: rgba(255, 255, 255, 0.75);
  padding-left: 38px;
  position: absolute;
  bottom: 20px;
  right: 20px;
  height: 23px;
  line-height: 23px;
  cursor: pointer;
  background: url(../asset/plus.png) no-repeat left center/23px;
}

.news-more:hover {
  color: rgba(255, 212, 159, 0.75);
}
</style>
